<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/10/7
 * Time: 14:34
 */

namespace App\Model;
use think\Model;

class Room extends Model
{
    protected $pk = "room_id";

    protected static function init()
    {
        //TODO:初始化内容
    }

    public function getRoomInfo($room_id){
        return $this->where('room_id', "=", $room_id)->find();
    }

    public function getRoomInfoByNumber($room_number){
        return $this->where('room_number',"=", $room_number)->find();
    }

    public function getRoomInfoByDataKey($data_key){
        return $this->db()->where('data_key',$data_key)->find();
    }

    public function insert(array $bean){
        return parent::insert($bean, false, true);
    }



}